# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#------------------------------------------------------------------------------
cmake_minimum_required (VERSION 3.5)
PROJECT(xo_tp_cxx)

SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)

FILE(GLOB src "*.cpp" "*.h" "*.hpp")
SOURCE_GROUP("Src" FILES ${src})

# folder used by the core developers
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/../../../cxx/include/)

# folder used by the app developers
INCLUDE_DIRECTORIES(/usr/include/sawtooth_sdk)


IF( UNIX )
    SET(CMAKE_CXX_FLAGS "-std=c++11" ${CMAKE_CXX_FLAGS})
ENDIF()

link_directories(${CMAKE_BINARY_DIR}/../../../cxx/build/lib)


ADD_EXECUTABLE(${PROJECT_NAME} ${src} )

TARGET_LINK_LIBRARIES(${PROJECT_NAME} sawtooth )

TARGET_LINK_LIBRARIES(${PROJECT_NAME} proto )
TARGET_LINK_LIBRARIES(${PROJECT_NAME} protobuf )
TARGET_LINK_LIBRARIES(${PROJECT_NAME} zmq)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} zmqpp)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} log4cxx)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} cryptopp)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} pthread)
